package com.example.springboot_demo.proxy;

import com.example.springboot_demo.service.UserService;
import com.example.springboot_demo.service.UserServiceImpl;

public class Demo {
    private static  CglibExample cglibExample=new CglibExample();
    private  CglibExample cglibExample1=new CglibExample();
    public static void main(String[] args) {
        UserService userService = new UserServiceImpl();
        UserService proxy = MyInvocationHandler.createProxy(userService, UserService.class);

        proxy.addUser("张三");
        System.out.println(proxy.getUser("123"));
        System.out.println("----------");
        userService.addUser("张三");
    }

}